﻿namespace HuaWei.CBR.QTJL
{
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using HuaWei.CommClass;
    using HuaWei.CommComp;
    using HuaWei.Common;
    using HuaWei.Windows.Forms;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmSPJE : FrmBase
    {
        private BindingSource bindingSource;
        private SimpleButton btnAdd;
        private SimpleButton btnDel;
        private SimpleButton btnSP;
        private DateEdit dateEdit1;
        private DateEdit detSPRQ;
        private TextEdit edtSPR;
        private MemoEdit edtSPYJ;
        private GridColumn gridColumn28;
        private GridColumn gridColumn7;
        private GridColumn gridColumn8;
        private GridControl gridControl1;
        private GridView gridView2;
        private GroupControl groupControl4;
        private GroupControl groupControl5;
        private IContainer icontainer1 = null;
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private MemoEdit memoEdit2;
        private PanelControl panelControl6;
        private RepositoryItemCheckEdit repositoryItemCheckEdit1;
        private RepositoryItemCheckEdit repositoryItemCheckEdit2;
        private RepositoryItemMemoEdit repositoryItemMemoEdit1;
        private RepositoryItemMemoExEdit repositoryItemMemoExEdit1;
        private SimpleButton simpleButton2;

        public FrmSPJE()
        {
            this.InitializeComponent();
            this.btnSP.Visible = !GParams._JGLX.Equals(JGLX.CBR);
        }

        private void bindingSource_PositionChanged(object sender, EventArgs e)
        {
            this.ControlFormStatus();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            DHelp.DataAddNew(this.bindingSource, "", "");
        }

        private void btnDel_Click(object sender, EventArgs e)
        {
            if ((this.bindingSource.List.Count > 0) && (MsgBox.ShowQuestion("是否删除当前记录？") == System.Windows.Forms.DialogResult.OK))
            {
                this.bindingSource.RemoveCurrent();
                base.Save();
            }
        }

        private void btnSP_Click(object sender, EventArgs e)
        {
            FrmSPYJ mspyj = new FrmSPYJ();
            mspyj.SetFrmParam(this.bindingSource);
            mspyj.ShowDialog();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer1 != null))
            {
                this.icontainer1.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmSPJE_Load(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void InitializeComponent()
        {
            this.icontainer1 = new Container();
            this.bindingSource = new BindingSource(this.icontainer1);
            this.groupControl5 = new GroupControl();
            this.memoEdit2 = new MemoEdit();
            this.gridControl1 = new GridControl();
            this.gridView2 = new GridView();
            this.gridColumn7 = new GridColumn();
            this.gridColumn8 = new GridColumn();
            this.gridColumn28 = new GridColumn();
            this.repositoryItemCheckEdit1 = new RepositoryItemCheckEdit();
            this.repositoryItemCheckEdit2 = new RepositoryItemCheckEdit();
            this.repositoryItemMemoExEdit1 = new RepositoryItemMemoExEdit();
            this.repositoryItemMemoEdit1 = new RepositoryItemMemoEdit();
            this.groupControl4 = new GroupControl();
            this.labelControl3 = new LabelControl();
            this.edtSPYJ = new MemoEdit();
            this.edtSPR = new TextEdit();
            this.labelControl4 = new LabelControl();
            this.detSPRQ = new DateEdit();
            this.labelControl5 = new LabelControl();
            this.panelControl6 = new PanelControl();
            this.simpleButton2 = new SimpleButton();
            this.btnSP = new SimpleButton();
            this.btnDel = new SimpleButton();
            this.btnAdd = new SimpleButton();
            this.labelControl2 = new LabelControl();
            this.dateEdit1 = new DateEdit();
            this.labelControl1 = new LabelControl();
            base.ds.BeginInit();
            base.dsQuery.BeginInit();
            base.dataSets.BeginInit();
            ((ISupportInitialize) this.bindingSource).BeginInit();
            this.groupControl5.BeginInit();
            this.groupControl5.SuspendLayout();
            this.memoEdit2.Properties.BeginInit();
            this.gridControl1.BeginInit();
            this.gridView2.BeginInit();
            this.repositoryItemCheckEdit1.BeginInit();
            this.repositoryItemCheckEdit2.BeginInit();
            this.repositoryItemMemoExEdit1.BeginInit();
            this.repositoryItemMemoEdit1.BeginInit();
            this.groupControl4.BeginInit();
            this.groupControl4.SuspendLayout();
            this.edtSPYJ.Properties.BeginInit();
            this.edtSPR.Properties.BeginInit();
            this.detSPRQ.Properties.VistaTimeProperties.BeginInit();
            this.detSPRQ.Properties.BeginInit();
            this.panelControl6.BeginInit();
            this.panelControl6.SuspendLayout();
            this.dateEdit1.Properties.VistaTimeProperties.BeginInit();
            this.dateEdit1.Properties.BeginInit();
            base.SuspendLayout();
            this.bindingSource.DataMember = "QTJL_SPJE";
            this.bindingSource.DataSource = base.dataSets;
            this.bindingSource.PositionChanged += new EventHandler(this.bindingSource_PositionChanged);
            this.groupControl5.Controls.Add(this.memoEdit2);
            this.groupControl5.Dock = DockStyle.Fill;
            this.groupControl5.Location = new Point(0x137, 0x1b);
            this.groupControl5.Name = "groupControl5";
            this.groupControl5.Size = new Size(0x1eb, 0x14d);
            this.groupControl5.TabIndex = 0x12;
            this.groupControl5.Text = "索赔依据";
            this.memoEdit2.DataBindings.Add(new Binding("EditValue", this.bindingSource, "SPYJ", true));
            this.memoEdit2.Dock = DockStyle.Fill;
            this.memoEdit2.Location = new Point(2, 0x17);
            this.memoEdit2.Name = "memoEdit2";
            this.memoEdit2.Size = new Size(0x1e7, 0x134);
            this.memoEdit2.TabIndex = 0x17;
            this.gridControl1.DataSource = this.bindingSource;
            this.gridControl1.Dock = DockStyle.Left;
            this.gridControl1.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl1.Location = new Point(0, 0x1b);
            this.gridControl1.MainView = this.gridView2;
            this.gridControl1.Name = "gridControl1";
            this.gridControl1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemCheckEdit2, this.repositoryItemCheckEdit1, this.repositoryItemMemoExEdit1, this.repositoryItemMemoEdit1 });
            this.gridControl1.Size = new Size(0x137, 0x14d);
            this.gridControl1.TabIndex = 20;
            this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView2 });
            this.gridView2.Columns.AddRange(new GridColumn[] { this.gridColumn7, this.gridColumn8, this.gridColumn28 });
            this.gridView2.GridControl = this.gridControl1;
            this.gridView2.Name = "gridView2";
            this.gridView2.OptionsCustomization.AllowFilter = false;
            this.gridView2.OptionsCustomization.AllowSort = false;
            this.gridView2.OptionsView.ColumnAutoWidth = false;
            this.gridView2.OptionsView.ShowGroupPanel = false;
            this.gridColumn7.Caption = "索赔日期";
            this.gridColumn7.FieldName = "SPRQ";
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 0;
            this.gridColumn7.Width = 0x5f;
            this.gridColumn8.Caption = "索赔金额";
            this.gridColumn8.FieldName = "SPJE";
            this.gridColumn8.Name = "gridColumn8";
            this.gridColumn8.Visible = true;
            this.gridColumn8.VisibleIndex = 1;
            this.gridColumn8.Width = 90;
            this.gridColumn28.Caption = "同意上报";
            this.gridColumn28.ColumnEdit = this.repositoryItemCheckEdit1;
            this.gridColumn28.FieldName = "TYSB";
            this.gridColumn28.Name = "gridColumn28";
            this.gridColumn28.Tag = "-1";
            this.gridColumn28.Visible = true;
            this.gridColumn28.VisibleIndex = 2;
            this.gridColumn28.Width = 60;
            this.repositoryItemCheckEdit1.AutoHeight = false;
            this.repositoryItemCheckEdit1.DisplayValueChecked = "1";
            this.repositoryItemCheckEdit1.DisplayValueUnchecked = "0";
            this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit1";
            this.repositoryItemCheckEdit1.NullStyle = StyleIndeterminate.Unchecked;
            this.repositoryItemCheckEdit1.ValueChecked = 1;
            this.repositoryItemCheckEdit1.ValueUnchecked = 0;
            this.repositoryItemCheckEdit2.AutoHeight = false;
            this.repositoryItemCheckEdit2.Name = "repositoryItemCheckEdit2";
            this.repositoryItemMemoExEdit1.AutoHeight = false;
            this.repositoryItemMemoExEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemMemoExEdit1.Name = "repositoryItemMemoExEdit1";
            this.repositoryItemMemoEdit1.Name = "repositoryItemMemoEdit1";
            this.groupControl4.Controls.Add(this.labelControl3);
            this.groupControl4.Controls.Add(this.edtSPYJ);
            this.groupControl4.Controls.Add(this.edtSPR);
            this.groupControl4.Controls.Add(this.labelControl4);
            this.groupControl4.Controls.Add(this.detSPRQ);
            this.groupControl4.Controls.Add(this.labelControl5);
            this.groupControl4.Dock = DockStyle.Bottom;
            this.groupControl4.Location = new Point(0, 360);
            this.groupControl4.Name = "groupControl4";
            this.groupControl4.Size = new Size(0x322, 0x9c);
            this.groupControl4.TabIndex = 0x13;
            this.groupControl4.Tag = "-3";
            this.groupControl4.Text = "审批意见";
            this.labelControl3.Location = new Point(12, 0x37);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(0x30, 14);
            this.labelControl3.TabIndex = 11;
            this.labelControl3.Text = "审批意见";
            this.edtSPYJ.DataBindings.Add(new Binding("EditValue", this.bindingSource, "SHYJ", true));
            this.edtSPYJ.Location = new Point(0x45, 0x35);
            this.edtSPYJ.Name = "edtSPYJ";
            this.edtSPYJ.Properties.ReadOnly = true;
            this.edtSPYJ.Size = new Size(410, 0x60);
            this.edtSPYJ.TabIndex = 10;
            this.edtSPR.DataBindings.Add(new Binding("EditValue", this.bindingSource, "SHR", true));
            this.edtSPR.Location = new Point(0xdf, 0x1a);
            this.edtSPR.Name = "edtSPR";
            this.edtSPR.Properties.ReadOnly = true;
            this.edtSPR.Size = new Size(100, 0x15);
            this.edtSPR.TabIndex = 9;
            this.labelControl4.Location = new Point(0xb2, 0x1d);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(0x24, 14);
            this.labelControl4.TabIndex = 8;
            this.labelControl4.Text = "审批人";
            this.detSPRQ.DataBindings.Add(new Binding("EditValue", this.bindingSource, "SHRQ", true));
            this.detSPRQ.EditValue = null;
            this.detSPRQ.Location = new Point(0x45, 0x1a);
            this.detSPRQ.Name = "detSPRQ";
            this.detSPRQ.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.detSPRQ.Properties.ReadOnly = true;
            this.detSPRQ.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.detSPRQ.Size = new Size(100, 0x15);
            this.detSPRQ.TabIndex = 7;
            this.labelControl5.Location = new Point(12, 0x1d);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x30, 14);
            this.labelControl5.TabIndex = 6;
            this.labelControl5.Text = "审批日期";
            this.panelControl6.Controls.Add(this.simpleButton2);
            this.panelControl6.Controls.Add(this.btnSP);
            this.panelControl6.Controls.Add(this.btnDel);
            this.panelControl6.Controls.Add(this.btnAdd);
            this.panelControl6.Dock = DockStyle.Top;
            this.panelControl6.Location = new Point(0, 0);
            this.panelControl6.Name = "panelControl6";
            this.panelControl6.Size = new Size(0x322, 0x1b);
            this.panelControl6.TabIndex = 0x16;
            this.simpleButton2.Dock = DockStyle.Left;
            this.simpleButton2.Location = new Point(0x98, 2);
            this.simpleButton2.Name = "simpleButton2";
            this.simpleButton2.Size = new Size(0x3a, 0x17);
            this.simpleButton2.TabIndex = 9;
            this.simpleButton2.Tag = "-2";
            this.simpleButton2.Text = "过程数据";
            this.simpleButton2.Click += new EventHandler(this.simpleButton2_Click);
            this.btnSP.Dock = DockStyle.Left;
            this.btnSP.Location = new Point(0x66, 2);
            this.btnSP.Name = "btnSP";
            this.btnSP.Size = new Size(50, 0x17);
            this.btnSP.TabIndex = 5;
            this.btnSP.Tag = "-1";
            this.btnSP.Text = "审批";
            this.btnSP.Click += new EventHandler(this.btnSP_Click);
            this.btnDel.Dock = DockStyle.Left;
            this.btnDel.Location = new Point(0x34, 2);
            this.btnDel.Name = "btnDel";
            this.btnDel.Size = new Size(50, 0x17);
            this.btnDel.TabIndex = 4;
            this.btnDel.Tag = "-1";
            this.btnDel.Text = "删除";
            this.btnDel.Click += new EventHandler(this.btnDel_Click);
            this.btnAdd.Dock = DockStyle.Left;
            this.btnAdd.Location = new Point(2, 2);
            this.btnAdd.Name = "btnAdd";
            this.btnAdd.Size = new Size(50, 0x17);
            this.btnAdd.TabIndex = 3;
            this.btnAdd.Tag = "-1";
            this.btnAdd.Text = "新增";
            this.btnAdd.Click += new EventHandler(this.btnAdd_Click);
            this.labelControl2.Location = new Point(0xb8, 0x11);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x30, 14);
            this.labelControl2.TabIndex = 2;
            this.dateEdit1.DataBindings.Add(new Binding("EditValue", this.bindingSource, "SPRQ", true));
            this.dateEdit1.EditValue = null;
            this.dateEdit1.Location = new Point(0x42, 14);
            this.dateEdit1.Name = "dateEdit1";
            this.dateEdit1.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dateEdit1.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dateEdit1.Size = new Size(100, 0x15);
            this.dateEdit1.TabIndex = 1;
            this.labelControl1.Location = new Point(12, 0x11);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x30, 14);
            this.labelControl1.TabIndex = 0;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x322, 0x204);
            base.Controls.Add(this.groupControl5);
            base.Controls.Add(this.gridControl1);
            base.Controls.Add(this.panelControl6);
            base.Controls.Add(this.groupControl4);
            base.Name = "FrmSPJE";
            this.Text = "索赔金额";
            base.Load += new EventHandler(this.FrmSPJE_Load);
            base.ds.EndInit();
            base.dsQuery.EndInit();
            base.dataSets.EndInit();
            ((ISupportInitialize) this.bindingSource).EndInit();
            this.groupControl5.EndInit();
            this.groupControl5.ResumeLayout(false);
            this.memoEdit2.Properties.EndInit();
            this.gridControl1.EndInit();
            this.gridView2.EndInit();
            this.repositoryItemCheckEdit1.EndInit();
            this.repositoryItemCheckEdit2.EndInit();
            this.repositoryItemMemoExEdit1.EndInit();
            this.repositoryItemMemoEdit1.EndInit();
            this.groupControl4.EndInit();
            this.groupControl4.ResumeLayout(false);
            this.groupControl4.PerformLayout();
            this.edtSPYJ.Properties.EndInit();
            this.edtSPR.Properties.EndInit();
            this.detSPRQ.Properties.VistaTimeProperties.EndInit();
            this.detSPRQ.Properties.EndInit();
            this.panelControl6.EndInit();
            this.panelControl6.ResumeLayout(false);
            this.dateEdit1.Properties.VistaTimeProperties.EndInit();
            this.dateEdit1.Properties.EndInit();
            base.ResumeLayout(false);
        }

        public override void LoadedForm()
        {
            base.SetBindingSource(this.bindingSource, "QTJL_SPJE", true);
            base.LoadedForm();
        }

        public override void LoadingData()
        {
            base.LoadingData();
            base.ds.Clear();
            string str = null;
            str = "select * from QTJL_SPJE " + Class28.YfQclfhSo(GParams.QCInfo.QCID, "");
            Class39.smethod4(base.ida, base.ds, str, "QTJL_SPJE", true);
        }

        private void method1(object sender, EventArgs e)
        {
        }

        public override void Saving()
        {
            base.Saving();
            this.bindingSource.EndEdit();
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            string objId = DHelp.GetObjId(this.bindingSource);
            base.OpenDataLog("QTJL_SPJE", GParams._BDID, GParams.QCInfo.QCID, objId);
        }
    }
}

